//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Mapping Application Block
//===============================================================================

namespace EntLibContrib.Mapping.Instrumentation
{
	/// <summary>
	/// Represents the WMI event fired when an error in the configuration for the mapping block is detected.
	/// </summary>
	public class MapperConfigurationFailureEvent : MapperEvent
	{
		#region Fields
		private string exceptionMessage;
		#endregion

		#region Properties
		/// <summary>
		/// Gets the message that represents the exception thrown when the configuration error was detected.
		/// </summary>
		public string ExceptionMessage
		{
			get { return exceptionMessage; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="MapperConfigurationFailureEvent"/> class.
		/// </summary>
		/// <param name="instanceName">Name of the <see cref="IMapper"/> instance the failure ocurred in.</param>
		/// <param name="exceptionMessage">The message that represents the exception thrown when the configuration error was detected.</param>
		public MapperConfigurationFailureEvent(string instanceName, string exceptionMessage)
			: base(instanceName)
		{
			this.exceptionMessage = exceptionMessage;
		}
		#endregion
	}
}